﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Page/Site.Master" AutoEventWireup="true" EnableEventValidation="false" CodeBehind="nhat-ky-hang-hoa.aspx.cs" Inherits="VanTaiTMS.Page.nhat_ky_hang_hoa" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
<!---AutoComplete-->
<script type="text/javascript">
    function pageLoad() {
        $(document).ready((function () {
            var availableTags1 = [<%= SuggestionList %>];

            $("#<%= txtSearch.ClientID %>").autocomplete({
                source: availableTags1
            });
        }));
    }
</script>
<!-------End------->
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<asp:UpdatePanel ID="upDatePanelAll" runat="server">
<ContentTemplate>
    <div id="toolbar-1" class="yui3-toolbar">
        <asp:Panel id="panel1" runat="server" DefaultButton="cmdSerach">
            <div class="div-search-texbox">
            <asp:TextBox ID="txtSearch" placeholder="Nhập vào từ khoá tìm kiếm..." CssClass="textbox_child_Search" runat="server"></asp:TextBox>
            </div>
            <div class="div-search">
            <asp:Button ID="cmdSerach" runat="server" CssClass="btn-add-search" Text="" OnClick="cmdSerach_Click" />
            <asp:Button ID="cmdRefesh" runat="server" CssClass="btn-add-refesh"  Text="" onclick="cmdRefesh_Click" />
            <input type="button" title="Xuất ra tập tin Excel" onclick="tableToExcel('testTable', 'W3C Example Table')" class="btn-add-excel" />
           </div>
        </asp:Panel>
        <div class="clr"></div>
     </div>     
     <%=StrAlert%>
    <!-----------Hiễn-Thị-Dữ-Liệu------------>
    <div class="ui-main">
    <span style="font-weight:bold;color:red">Thông tin hàng hoá</span>
    <table  class="bordered" id="testTable">
        <thead>
            <tr>
                <th width="5%">STT</th>        
                <th width="5%">
                    <input type="checkbox" onclick="checkAll('chkList');" id="chkAll">
                </th>
                <th width="10%">Mã hàng hoá</th>
                <th width="10%">Ngày lập</th>
            </tr>
        </thead>

        <tbody>
             <asp:ListView ID="ListViewAll" runat="server" ItemPlaceholderID="lstViewAll" DataKeyNames="RowID" OnItemCommand="ListViewAll_ItemCommand" OnItemDataBound="ListViewAll_ItemDataBound">
                <ItemTemplate>
                    <tr runat="server" id="SetColor">
                        <td align="center" style="text-align:center">
                            <asp:Label ID="lb_lst_ID" runat="server" Text='<%# Eval("RowID") %>'></asp:Label>
                        </td>

                        <td style="text-align:center">
                            <asp:CheckBox ID="chkList" onclick='highlight(this)' ClientIDMode="Static" runat="server" />
                        </td>

                        <td style="text-align:center">
                            <asp:LinkButton ID="linkListName_A" CommandName="Accept" runat="server"><%# Eval("No_")%></asp:LinkButton>
                        </td>

                        <td style="text-align:center">
                            <asp:LinkButton ID="linkListName" CommandName="Accept" runat="server"><%# Eval("PostingDate","{0:dd/MM/yyyy}")%></asp:LinkButton>
                            <input type="hidden" id="hiddenId" value='<%# Eval("No_") %>' runat="server" name="hiddenId" />
                        </td>
                    </tr>
                </ItemTemplate>
                <LayoutTemplate>
                    <asp:PlaceHolder runat="server" ID="lstViewAll"></asp:PlaceHolder>
                </LayoutTemplate>
             </asp:ListView>
        </tbody>
    </table>
    <!--------------Kêt-thúc----------------->

    <!-------------Phân-trang---------------->
    <table  class="bordered">
        <thead>
            <tr>
                <th class="pager">
                    <asp:DataPager ID="DataPagerListAll" runat="server" 
                        OnPreRender="DataPagerListAll_PreRender" PagedControlID="ListViewAll">
                        <Fields>
                            <asp:NextPreviousPagerField FirstPageText="&lt;&lt;" PreviousPageText="&lt;" 
                                ShowFirstPageButton="True" ShowNextPageButton="False" />
                            <asp:NumericPagerField />
                            <asp:NextPreviousPagerField LastPageText="&gt;&gt;" NextPageText="&gt;" 
                                ShowLastPageButton="True" ShowPreviousPageButton="False" />
                        </Fields>
                    </asp:DataPager>
                </th>
            </tr>
        </thead>
    </table>
    <!--------------Kêt-thúc----------------->
    <div class="clr"></div>
    </div>
    <div style="height:20px"></div>
    <div class="ui-main">
    <span style="font-weight:bold;color:red">Chi tiết hàng hoá</span>
    <table  class="bordered">
        <thead>
            <tr>      
                <th width="10%">Mã hàng hoá</th>
                <th width="10%">Đơn vị tính</th>
                <th width="10%">Khối lượng</th>
                <th width="10%">Số lượng</th>
                <th width="10%">Tổng tiền</th>
                <th width="10%">Ngày lập</th>
            </tr>
        </thead>

        <tbody>
             <asp:ListView ID="ListViewDetail" runat="server" ItemPlaceholderID="lstViewDetail" DataKeyNames="RowID" OnItemCommand="ListViewAll_ItemCommand" OnItemDataBound="ListViewAll_ItemDataBound">
                <ItemTemplate>
                    <tr runat="server" id="SetColor">
                        <td style="text-align:center">
                            <asp:LinkButton ID="linkListName" CommandName="Accept" runat="server"><%# Eval("ItemNo")%></asp:LinkButton>
                            <input type="hidden" id="hiddenId" value='<%# Eval("RowID") %>' runat="server" name="hiddenId" />
                        </td>

                        <td style="text-align:center">
                            <asp:LinkButton ID="LinkButton1" CommandName="Accept" runat="server"><%# Eval("Unit")%></asp:LinkButton>
                        </td>

                        <td style="text-align:center">
                            <asp:LinkButton ID="LinkButton2" CommandName="Accept" runat="server"><%# Eval("NetWeight")%></asp:LinkButton>
                        </td>

                        <td style="text-align:center">
                            <asp:LinkButton ID="LinkButton3" CommandName="Accept" runat="server"><%# Eval("Amount")%></asp:LinkButton>
                        </td>

                        <td style="text-align:center">
                            <asp:LinkButton ID="LinkButton4" CommandName="Accept" runat="server"><%# Eval("Total")%></asp:LinkButton>
                        </td>

                        <td style="text-align:center">
                            <asp:LinkButton ID="LinkButton5" CommandName="Accept" runat="server"><%# Eval("PostingDate","{0:dd/MM/yyyy}")%></asp:LinkButton>
                        </td>
                    </tr>
                </ItemTemplate>
                <LayoutTemplate>
                    <asp:PlaceHolder runat="server" ID="lstViewDetail"></asp:PlaceHolder>
                </LayoutTemplate>
             </asp:ListView>
        </tbody>
    </table>
    <div class="clr"></div>
    </div>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
